package ex.com.jm.food.service.impl;

import java.util.List;

import ex.com.jm.food.dao.UserOrderDao;
import ex.com.jm.food.entity.Company;
import ex.com.jm.food.entity.CompanyProfit;
import ex.com.jm.food.entity.FoodCart;
import ex.com.jm.food.entity.Order;
import ex.com.jm.food.entity.OrderItem;
import ex.com.jm.food.entity.User;
import ex.com.jm.food.service.UserOrderService;

public class UserOrderServiceImpl implements UserOrderService {

	private UserOrderDao userOrderDao;
	
	public UserOrderDao getUserOrderDao() {
		return userOrderDao;
	}

	public void setUserOrderDao(UserOrderDao userOrderDao) {
		this.userOrderDao = userOrderDao;
	}

	@Override
	public List<Order> getOrders(String userPhone, String s_date,
			String e_date, int initPage, int pageRow) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().getOrders(userPhone, s_date, e_date, initPage, pageRow);
	}

	@Override
	public Object saveOrder(Order order) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().saveOrder(order);
	}

	@Override
	public Order getOrder(String orderId) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().getOrder(orderId);
	}

	@Override
	public void delOrder(String orderId) {
		// TODO Auto-generated method stub
        this.getUserOrderDao().delOrder(orderId);
	}

	@Override
	public List<OrderItem> getOrderItems(String orderId, int initPage,
			int pageRow) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().getOrderItems(orderId, initPage, pageRow);
	}

	@Override
	public Object saveOrderItem(OrderItem orderItem) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().saveOrderItem(orderItem);
	}

	@Override
	public void delOrderItem(String orderItemId) {
		// TODO Auto-generated method stub
        this.getUserOrderDao().delOrderItem(orderItemId);
	}

	@Override
	public int orderCount(String userPhone, String s_date, String e_date) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().orderCount(userPhone, s_date, e_date);
	}

	@Override
	public int orderItemCount(String orderId) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().orderItemCount(orderId);
	}

	@Override
	public Object saveCompanyProfit(CompanyProfit companyProfit) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().saveCompanyProfit(companyProfit);
	}

	@Override
	public User getUser(String userId) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().getUser(userId);
	}

	@Override
	public Company getCompany(String comId) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().getCompany(comId);
	}

	@Override
	public FoodCart getFoodCart(String cratId) {
		// TODO Auto-generated method stub
		return this.getUserOrderDao().getFoodCart(cratId);
	}

}
